package com.example.inventory;

import java.util.Date;
import java.sql.Timestamp;

import android.content.ContentValues;

public class recInventory implements DBAccess{
	private int       id;
	private Timestamp tstpFrom;
	private Timestamp tstpEnd;
	private int       locID;
	private int       creatorID;
	private int       invState;
	  
  public recInventory( Date date, String time, String state) {
	  this.id = -1;
  }
  
  public recInventory() { 
    tstpFrom = new java.sql.Timestamp( System.currentTimeMillis() );
    tstpEnd  = new java.sql.Timestamp( System.currentTimeMillis() );
  }
  
// Setter for persisting data
  public void setTstpFrom(){
	  this.tstpFrom.setTime(System.currentTimeMillis());
  }
  
  public void setTstpEnd(){
	  this.tstpEnd.setTime(System.currentTimeMillis());
  }
  
  public void setLocID(int locID){
	  this.locID = locID;
  }
  
  public void setInvID(int invID){
	  this.creatorID = invID;
  }
  
  public void setInvState(int invState){
	  this.invState = invState;
  }
// Getter for database access
  public String getTstpFrom( )  {
	  return tstpFrom.toString( );
  }
  
  public String getTstpEnd( ) {
	  return tstpEnd.toString( );
  }
  
  public int getLocID(){
	  return locID;
  }
  
  public int getCreatorID() {
	  return creatorID;
  }
  
  public int getInvState() {
	  return invState;
  }
  
  public ContentValues getContentValues(){
	  ContentValues data = new ContentValues();
		
		data.put("tstp_start",  this.getTstpFrom());
		data.put("tstp_end"  ,  this.getTstpEnd());
		data.put("creator_ID",  this.getCreatorID());
		data.put("location_ID", this.getLocID());
		data.put("state",       this.getInvState());

		return data; 
  }
  
  
  
}
